﻿using DataScripter.Util;

namespace DataScripter.Database.SqlServer
{
    static class DbFactory
    {
        public static Db CreateDatabase(string instance, string database)
        {
            return new SqlServerDb(instance, database);
        }

        public static Db CreateDatabase(string connectionString)
        {
            string instance;
            string database;
            ConnectionStringHelper.ExtractServerAndDatabase(connectionString, out instance, out database);
            return CreateDatabase(instance, database);
        }
    }
}
